<template>
    <div>
        <mt-header class="m_mint_header" title="语言设置">
            <router-link to="/" slot="left">
                <mt-button icon="back"></mt-button>
            </router-link>
        </mt-header>
        <div class="mint_language">
            <mt-radio
                    align="right"
                    v-model="lang"
                    :options="options"
                    @change="changeLang"
            >
            </mt-radio>
        </div>
    </div>
</template>

<script>
    export default {
        name: "Language",
        data(){
            return{
                options: [{
                    value: 'zh-CN',
                    label: '简体中文'
                }, {
                    value: 'zh-US',
                    label: '英文'
                }],
                lang:"zh-CN",
            }
        },
        methods:{
            changeLang(){
                this.$i18n.locale = this.lang;
                this.$toast({
                    message: this.$t('toast.success'),
                    duration: 1000
                });
            }
        }
    }
</script>

<style>

.mint_language .mint-cell{
    border-bottom:1px solid #f0f0f8;
}

.mint_language .mint-radio-input:checked + .mint-radio-core{
    background-color: #f7961f;
    border-color: #f7961f;
}
.mint_language a:focus,.mint_language a:hover{
    color:#333;
}
a:focus, a:hover{
    color: #333;
}
</style>
